<template>
  <el-descriptions v-if="false">
    <el-descriptions-item v-if="false">
    </el-descriptions-item>
  </el-descriptions>



  <div class="el-descriptions el-descriptions--default" data-v-687f4388="">
    <div class="el-descriptions__body">
      <table class="el-descriptions__table is-bordered">
        <tbody>
        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            资源编号
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.trafficNo}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.trafficNo" v-model:copy-prop="edit.trafficNo"></my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            资源名称
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.trafficName}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.trafficName" v-model:copy-prop="edit.trafficName"></my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            出发时间
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.startTime}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.startTime" v-model:copy-prop="edit.startTime">
              <time-input :clearable="false" style="width: 100%"
                          v-model:time-str="edit.startTime">
              </time-input>
            </my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            到达时间
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.reachTime}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.reachTime" v-model:copy-prop="edit.reachTime">
              <time-input :clearable="false" style="width: 100%"
                          v-model:time-str="edit.reachTime">
              </time-input>
            </my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            出发城市
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{
              cityToStr(origin.startCity)
            }}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.startCity"
                       v-model:copy-prop="edit.startCity"
                       :show-tag="origin.startCity?.cityId!==edit.startCity?.cityId">
              <city-input-no-x v-model:city-object="edit.startCity"></city-input-no-x>
            </my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            目的城市
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{
              cityToStr(origin.destCity)
            }}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.destCity"
                       v-model:copy-prop="edit.destCity"
                       :show-tag="origin.destCity?.cityId!==edit.destCity?.cityId">
              <city-input-no-x v-model:city-object="edit.destCity"></city-input-no-x>
            </my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            出发地址
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.startAddress}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.startAddress" v-model:copy-prop="edit.startAddress"></my-el-tag>
          </td>
        </tr>
        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            到达地址
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.destAddress}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.destAddress" v-model:copy-prop="edit.destAddress"></my-el-tag>
          </td>
        </tr>
        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            负责人电话
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.phone}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.phone" v-model:copy-prop="edit.phone"></my-el-tag>
          </td>
        </tr>
        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            默认价格
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.defaultPrice}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.defaultPrice" v-model:copy-prop="edit.defaultPrice">
              <el-input-number  v-model="edit.defaultPrice"></el-input-number>
            </my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            默认库存
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.defaultStore}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.defaultStore" v-model:copy-prop="edit.defaultStore">
              <el-input-number  v-model="edit.defaultStore"></el-input-number>
            </my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            开放天数
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            {{origin.openDay}}
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="1">
            <my-el-tag v-model:origin-prop="origin.openDay" v-model:copy-prop="edit.openDay">
              <el-input-number  v-model="edit.openDay"></el-input-number>
            </my-el-tag>
          </td>
        </tr>

        <tr>
          <td class="el-descriptions__cell el-descriptions__label is-bordered-label is-left" colspan="1">
            详情描述
          </td>
          <td class="el-descriptions__cell el-descriptions__content is-bordered-content is-left" colspan="2">
            <el-tag type="success" v-if="origin.introduceId===edit.introduceId">产品详情未编辑</el-tag>
            <el-tag type="warning" v-else>产品详情已编辑</el-tag>
          </td>

        </tr>

        </tbody>
      </table>
    </div>
  </div>

</template>

<script setup>

import MyElTag from "~/components/MyElTag.vue";
import {cityToStr} from "~/config/utils.js";
import CityInputNoX from "~/components/CityInputNoX.vue";


defineProps(['origin','edit'])
</script>

<style scoped>

</style>